﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using DataAccessComponents;
using BusinessLogicLayer;
using System.Collections.ObjectModel;
using System.Data;

namespace inzWeb
{
    public partial class oferta : System.Web.UI.Page
    {

        protected void Page_Load(object sender, EventArgs e)
        {

            pagerGora.pager_PageIndexChanged += new EventHandler(pager_pager_PageIndexChanged);
            //  pagerDol.pager_PageIndexChanged += new EventHandler(pager_pager_PageIndexChanged);
            if (!IsPostBack)
            {

                uzupelnijListeKrajow();
            }
        }       

        void pager_pager_PageIndexChanged(object sender, EventArgs e)
        {
            uzupelnijListeKrajow();
        }

        private void uzupelnijListeKrajow()
        {
            KrajBL krajBL = new KrajBL();
            ObservableCollection<Kraj> listaKraje = krajBL.pobierzListe();

            pagerGora.bindDataWithPaging<Kraj>(dlListaKraje, listaKraje);
            //    pagerDol.bindDataWithPaging<Kraj>(dlListaKraje, listaKraje);

        }    
    }
}